package com.zm.se.listenner;


import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.zm.se.entity.Equipment;
import com.zm.se.mapper.EquipmentMapper.EquMapper;

public class EquExcelListener extends AnalysisEventListener<Equipment> {

    private EquMapper mapper;


    public EquExcelListener(EquMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public void invoke(Equipment equipmentOriginal, AnalysisContext analysisContext) {
        System.out.println(equipmentOriginal);
        System.out.println(mapper.InsertEqu(equipmentOriginal));
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("finish");
    }
}
